bitkeeper revision 1.1159.170.23 (41988b637H-s7zBc_EhrKCZog7CGNw)
authorkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Mon, 15 Nov 2004 10:56:35 +0000 (10:56 +0000)
committerkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Mon, 15 Nov 2004 10:56:35 +0000 (10:56 +0000)
Clean up multi-kernel build system.

Makefile
buildconfigs/Rules.mk

index b5cb717dad2411f757b83ab87b24973567d9369e..a3675f7634d0f4c83e9d5e1f8e0e26c7304a9cb8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,25 +5,23 @@
 DIST_DIR    ?= $(shell pwd)/dist
 INSTALL_DIR ?= $(DIST_DIR)/install
 
-SOURCEFORGE_MIRROR := http://heanet.dl.sourceforge.net/sourceforge
-#http://voxel.dl.sourceforge.net/sourceforge/
-#http://easynews.dl.sourceforge.net/sourceforge
+KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
+# linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU
 
-#KERNELS ?= mk.linux-2.6-xen0 mk.linux-2.6-xenU mk.linux-2.4-xen0 mk.linux-2.4-xenU mk.netbsd-2.0-xenU
-KERNELS ?= mk.linux-2.6-xen0 mk.linux-2.6-xenU
-
-ALLKERNELS = $(patsubst buildconfigs/%,%,$(wildcard buildconfigs/mk.*))
+ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
 ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
 
-export INSTALL_DIR SOURCEFORGE_MIRROR
+export INSTALL_DIR
+
+include buildconfigs/Rules.mk
 
 .PHONY:        all dist install xen tools kernels docs world clean mkpatches mrproper
 .PHONY:        kbuild kdelete kclean
 
-all:   dist
+all: dist
 
 # build and install everything into local dist directory
-dist:  xen tools kernels docs
+dist: xen tools kernels docs
        install -m0644 ./COPYING $(DIST_DIR)
        install -m0644 ./README $(DIST_DIR)
        install -m0755 ./install.sh $(DIST_DIR)
@@ -47,27 +45,27 @@ xen:
 tools:
        $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install
 
-# Build all the various kernels and modules
 kernels:
-       for i in $(KERNELS) ; do $(MAKE) -f buildconfigs/$$i build ; done
+       for i in $(KERNELS) ; do $(MAKE) $$i-build ; done
 
 docs:
        sh ./docs/check_pkgs && \
                $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C docs install || true
 
+# Build all the various kernels and modules
 kbuild: kernels
 
 # Delete the kernel build trees entirely
 kdelete:
-       for i in $(KERNELS) ; do $(MAKE) -f buildconfigs/$$i delete ; done
+       for i in $(KERNELS) ; do $(MAKE) $$i-delete ; done
 
 # Clean the kernel build trees
 kclean:
-       for i in $(KERNELS) ; do $(MAKE) -f buildconfigs/$$i clean ; done
+       for i in $(KERNELS) ; do $(MAKE) $$i-clean ; done
 
 # Make patches from kernel sparse trees
 mkpatches:
-       for i in $(ALLSPARSETREES) ; do $(MAKE) -f buildconfigs/Rules.mk $$i-xen.patch ; done
+       for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch ; done
 
 
 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
@@ -87,8 +85,8 @@ clean:
 # clean, but blow away kernel build tree plus tar balls
 mrproper: clean
        rm -rf dist patches/tmp
-       for i in $(ALLKERNELS) ; do $(MAKE) -f buildconfigs/$$i delete ; done
-       for i in $(ALLSPARSETREES) ; do $(MAKE) -f buildconfigs/Rules.mk $$i-mrproper ; done
+       for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
+       for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
 
 install-twisted:
        wget http://www.twistedmatrix.com/products/get-current.epy
@@ -113,16 +111,14 @@ uninstall:
        cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen 
        rm -rf "/usr/lib/python2.?/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.?/site-packages/Xc*"
 
-# Legacy target for compatibility
+# Legacy targets for compatibility
 linux24:
-       $(MAKE) -f buildconfigs/mk.linux-2.4-xen0 build
-       $(MAKE) -f buildconfigs/mk.linux-2.4-xenU build
+       $(MAKE) linux-2.4-xen0-build
+       $(MAKE) linux-2.4-xenU-build
 
-# Legacy target for compatibility
 linux26:
-       $(MAKE) -f buildconfigs/mk.linux-2.6-xen0 build
-       $(MAKE) -f buildconfigs/mk.linux-2.6-xenU build
+       $(MAKE) linux-2.6-xen0-build
+       $(MAKE) linux-2.6-xenU-build
 
-# Legacy target for compatibility
 netbsd20:
-       $(MAKE) -f buildconfigs/mk.netbsd-2.0-xenU build
+       $(MAKE) netbsd-2.0-xenU-build
index 31e8c8e8c723a624f42431b088ef309cb23f947a..3fbef08e19da8ea90fc98b6ca84f78a1410eeeda 100644 (file)
@@ -1,17 +1,10 @@
 
-# We expect these two to already be set if people 
-# are using the top-level Makefile
-DIST_DIR       ?= $(shell pwd)/dist
-INSTALL_DIR    ?= $(DIST_DIR)/install
-
 .PHONY:        mkpatches mrproper
 
-
 # Setup pristine search path
 PRISTINE_SRC_PATH      ?= .:..
 vpath pristine-% $(PRISTINE_SRC_PATH)
 
-
 # Expand Linux series to Linux version
 LINUX_SERIES   ?= 2.6
 LINUX_VER      ?= $(patsubst linux-%-xen-sparse,%,$(wildcard linux-$(LINUX_SERIES)*-xen-sparse))
@@ -26,8 +19,6 @@ linux-%.tar.bz2:
        @echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
        wget http://www.kernel.org/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
 
-
-
 # Expand NetBSD release to NetBSD version
 NETBSD_RELEASE  ?= 2.0
 NETBSD_VER      ?= $(patsubst netbsd-%-xen-sparse,%,$(wildcard netbsd-$(NETBSD_RELEASE)*-xen-sparse))
@@ -45,9 +36,6 @@ netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2:
 netbsd-%.tar.bz2: netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
        ln -fs $< $@
 
-
-
-
 pristine-%: %.tar.bz2
        rm -rf tmp-$(@F) $@
        mkdir -p tmp-$(@F)
@@ -56,6 +44,15 @@ pristine-%: %.tar.bz2
        touch $@ # update timestamp to avoid rebuild
        @rm -rf tmp-$(@F)
 
+%-build:
+       $(MAKE) -f buildconfigs/mk.$* build
+
+%-delete:
+       $(MAKE) -f buildconfigs/mk.$* delete
+
+%-clean:
+       $(MAKE) -f buildconfigs/mk.$* clean
+
 %-xen.patch: pristine-%
        rm -rf tmp-$@
        cp -al $< tmp-$@